package com.ymdx.service;

import com.ymdx.entity.IdEntity;

import java.io.Serializable;
import java.util.List;

/**
 * Created by yangliwei on 2017/8/13.
 */
public interface BaseService<T extends IdEntity, PK extends Serializable> {
    // save
    public void save(T entity);

    /**
     *
     * @param clazz
     * @param id
     * @return Entity or null
     */
    public T getById(Class<T> clazz, PK id);


    public void delete(T entity);



    /**
     * //查询， 基于and 和= 对于字符串 非模糊
     * @param entity
     * @return list对象  0
     */
    public List<T> getByExample(T entity);


}
